package com.aw.guiguzi.util

import android.app.Activity
import com.aw.baselib.util.AwDataUtil
import com.aw.baselib.util.AwDateUtil
import com.aw.baselib.util.AwLog
import com.aw.guiguzi.R
import com.aw.guiguzi.bean.CalResultBean
import com.aw.guiguzi.bean.NumEncloseBean
import com.aw.guiguzi.bean.NumHandleInputResultBean
import com.aw.guiguzi.bean.NumItemBean
import com.aw.guiguzi.enums.NumBettingEnums
import com.aw.guiguzi.enums.NumMutipleEnums
import java.util.Arrays
import java.util.Date

object CalResultUtil {
    fun calResultCount(myNumList: List<NumItemBean?>, resultNum: Int): CalResultBean {
        var totalSilver = 0
        var totalSkin = 0
        var totalGemstone = 0
        var totalResultSilver = 0
        var totalResultSkin = 0
        var totalResultGemstone = 0
        val sb = StringBuffer()
        if (!AwDataUtil.isEmpty(myNumList)) {
            if (resultNum == -1) {
                sb.append("下注:\n")
            } else {
                sb.append("结果数字: $resultNum ,下注:\n")
            }
            for (itemBean in myNumList) {
                AwLog.d("calResultCount numList: " + itemBean!!.name)
                totalSilver += itemBean.getSilverCount()
                totalSkin += itemBean.getSkinCount()
                totalGemstone += itemBean.getGemstoneCount()
                sb.append("[").append(itemBean.name).append("]").append(",")
                    .append("银: " + itemBean.getSilverCount() + ",皮: " + itemBean.getSkinCount() + ",宝石: " + itemBean.getGemstoneCount())
                    .append("\n")
                if (resultNum != -1 && itemBean.numList!!.contains(resultNum)) {
                    if (itemBean.is10()) {
                        totalResultSilver += itemBean.getSilverCount() * 10
                        totalResultSkin += itemBean.getSkinCount() * 10
                        totalResultGemstone += itemBean.getGemstoneCount() * 10
                    } else if (itemBean.is5()) {
                        totalResultSilver += itemBean.getSilverCount() * 5
                        totalResultSkin += itemBean.getSkinCount() * 5
                        totalResultGemstone += itemBean.getGemstoneCount() * 5
                    } else if (itemBean.is2Point5()) {
                        totalResultSilver += (itemBean.getSilverCount() * 2.5).toInt()
                        totalResultSkin += (itemBean.getSkinCount() * 2.5).toInt()
                        totalResultGemstone += (itemBean.getGemstoneCount() * 2.5).toInt()
                    } else if (itemBean.is2()) {
                        totalResultSilver += itemBean.getSilverCount() * 2
                        totalResultSkin += itemBean.getSkinCount() * 2
                        totalResultGemstone += itemBean.getGemstoneCount() * 2
                    }
                }
            }
        }
        val resultSilver = totalResultSilver - totalSilver
        val resultSkin = totalResultSkin - totalSkin
        val resultGemstone = totalResultGemstone - totalGemstone
        AwLog.d("\n下注: 银: $totalSilver,皮: $totalSkin,宝石: $totalGemstone")
        sb.append("\n下注: 银: $totalSilver,皮: $totalSkin,宝石: $totalGemstone")
        if (resultNum != -1) {
            sb.append("\n开奖: 银: $totalResultSilver ,皮: $totalResultSkin ,宝石: $totalResultGemstone")
            sb.append("\n盈亏: 银: $resultSilver ,皮: $resultSkin ,宝石: $resultGemstone")
        }
        val bean = CalResultBean(resultNum, resultSilver, resultSkin, resultGemstone, sb.toString())
        bean.totalSilver = totalSilver
        bean.totalSkin = totalSkin
        bean.totalGemstone = totalGemstone
        return bean
    }

    fun calResultCount(bean: NumHandleInputResultBean): CalResultBean {
        val sb = StringBuffer()
        if (!AwDataUtil.isEmpty(bean.list)) {
            sb.append(
                """结果数字: ${bean.resultNumber} ,下注:
"""
            )
            for (itemBean in bean.list!!) {
                sb.append("[").append(itemBean?.name).append("]")
            }
        }
        sb.append(
            """
    
    
    下注: 银: ${bean.silverCount},皮: ${bean.skinCount},宝石: ${bean.gemstoneCount}
    """.trimIndent()
        )
        val resultSliverCount = bean.silverCountTotal - bean.silverCount
        val resultSkinCount = bean.skinCountTotal - bean.skinCount
        val resultGemstoneCount = bean.gemstoneCountTotal - bean.gemstoneCount
        sb.append(
            """
开奖: 银: ${bean.silverCountTotal} ,皮: ${bean.skinCountTotal} ,宝石: ${bean.gemstoneCountTotal}"""
        )
        sb.append("\n盈亏: 银: $resultSliverCount,皮: $resultSkinCount,宝石: $resultGemstoneCount")
        return CalResultBean(
            bean.resultNumber,
            resultSliverCount,
            resultSkinCount,
            resultGemstoneCount,
            sb.toString()
        )
    }

    fun generateNumList(): MutableList<NumItemBean> {
        val list: MutableList<NumItemBean> = ArrayList()
        list.add(NumItemBean("0", 10f, ArrayList(Arrays.asList(*arrayOf(0)))))
        list.add(NumItemBean("1", 10f, ArrayList(Arrays.asList(*arrayOf(1)))))
        list.add(NumItemBean("2", 10f, ArrayList(Arrays.asList(*arrayOf(2)))))
        list.add(NumItemBean("3", 10f, ArrayList(Arrays.asList(*arrayOf(3)))))
        list.add(NumItemBean("4", 10f, ArrayList(Arrays.asList(*arrayOf(4)))))
        list.add(NumItemBean("5", 10f, ArrayList(Arrays.asList(*arrayOf(5)))))
        list.add(NumItemBean("6", 10f, ArrayList(Arrays.asList(*arrayOf(6)))))
        list.add(NumItemBean("7", 10f, ArrayList(Arrays.asList(*arrayOf(7)))))
        list.add(NumItemBean("8", 10f, ArrayList(Arrays.asList(*arrayOf(8)))))
        list.add(NumItemBean("9", 10f, ArrayList(Arrays.asList(*arrayOf(9)))))
        list.add(NumItemBean("01", 5f, ArrayList(Arrays.asList(*arrayOf(0, 1)))))
        list.add(NumItemBean("02", 5f, ArrayList(Arrays.asList(*arrayOf(0, 2)))))
        list.add(NumItemBean("13", 5f, ArrayList(Arrays.asList(*arrayOf(1, 3)))))
        list.add(NumItemBean("23", 5f, ArrayList(Arrays.asList(*arrayOf(2, 3)))))
        list.add(NumItemBean("24", 5f, ArrayList(Arrays.asList(*arrayOf(2, 4)))))
        list.add(NumItemBean("35", 5f, ArrayList(Arrays.asList(*arrayOf(3, 5)))))
        list.add(NumItemBean("45", 5f, ArrayList(Arrays.asList(*arrayOf(4, 5)))))
        list.add(NumItemBean("46", 5f, ArrayList(Arrays.asList(*arrayOf(4, 6)))))
        list.add(NumItemBean("57", 5f, ArrayList(Arrays.asList(*arrayOf(5, 7)))))
        list.add(NumItemBean("67", 5f, ArrayList(Arrays.asList(*arrayOf(6, 7)))))
        list.add(NumItemBean("68", 5f, ArrayList(Arrays.asList(*arrayOf(6, 8)))))
        list.add(NumItemBean("79", 5f, ArrayList(Arrays.asList(*arrayOf(7, 9)))))
        list.add(NumItemBean("89", 5f, ArrayList(Arrays.asList(*arrayOf(8, 9)))))
        list.add(NumItemBean("0123", 2.5f, ArrayList(Arrays.asList(*arrayOf(0, 1, 2, 3)))))
        list.add(NumItemBean("2345", 2.5f, ArrayList(Arrays.asList(*arrayOf(2, 3, 4, 5)))))
        list.add(NumItemBean("4567", 2.5f, ArrayList(Arrays.asList(*arrayOf(4, 5, 6, 7)))))
        list.add(NumItemBean("6789", 2.5f, ArrayList(Arrays.asList(*arrayOf(6, 7, 8, 9)))))
        list.add(NumItemBean("01234", 2f, ArrayList(Arrays.asList(*arrayOf(0, 1, 2, 3, 4)))))
        list.add(NumItemBean("56789", 2f, ArrayList(Arrays.asList(*arrayOf(5, 6, 7, 8, 9)))))
        var silverCount = 0
        var skinCount = 0
        var gemstoneCount = 0
        if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_10.desc) {
            silverCount = 1
            skinCount = 1
            gemstoneCount = 10
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_20.desc) {
            silverCount = 1
            skinCount = 1
            gemstoneCount = 20
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_40.desc) {
            silverCount = 1
            skinCount = 1
            gemstoneCount = 40
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_20.desc) {
            silverCount = 2
            skinCount = 2
            gemstoneCount = 20
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_40.desc) {
            silverCount = 2
            skinCount = 2
            gemstoneCount = 40
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_3_3_30.desc) {
            silverCount = 3
            skinCount = 3
            gemstoneCount = 30
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_4_4_40.desc) {
            silverCount = 4
            skinCount = 4
            gemstoneCount = 40
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_50.desc) {
            silverCount = 5
            skinCount = 5
            gemstoneCount = 50
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_100.desc) {
            silverCount = 5
            skinCount = 5
            gemstoneCount = 100
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_100.desc) {
            silverCount = 10
            skinCount = 10
            gemstoneCount = 100
        } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_200.desc) {
            silverCount = 10
            skinCount = 10
            gemstoneCount = 200
        } else {
            val bettingCustomArrays =
                AppCacheUtil.getBettingCustom().split("/".toRegex()).dropLastWhile { it.isEmpty() }
                    .toTypedArray()
            silverCount = AwDataUtil.getIntValue(bettingCustomArrays[0])
            skinCount = AwDataUtil.getIntValue(bettingCustomArrays[1])
            gemstoneCount = AwDataUtil.getIntValue(bettingCustomArrays[2])
        }
        for (itemBean in list) {
            itemBean.setSilverCount(silverCount)
            itemBean.setSkinCount(skinCount)
            itemBean.setGemstoneCount(gemstoneCount)
        }
        return list
    }

    fun getDefaultConfigBlockIndex(activity: Activity): Int {
        val list = Arrays.asList(*activity.resources.getStringArray(R.array.config_block))
        return list.indexOf(AppCacheUtil.getBettingConfigBlock())
    }

    fun getSpecialBlockList(block: String?): List<String?> {
        AppCacheUtil.setBettingConfigBlock(block)
        var list: List<String?> = ArrayList()
        when (block) {
            "小" -> list = ArrayList(Arrays.asList(*arrayOf("0", "1", "2", "3", "4")))
            "围小" -> list = ArrayList(
                Arrays.asList(
                    *arrayOf(
                        "0",
                        "1",
                        "2",
                        "3",
                        "4",
                        "01",
                        "02",
                        "13",
                        "23",
                        "24",
                        "35",
                        "45",
                        "46",
                        "0123",
                        "2345",
                        "01234"
                    )
                )
            )

            "大" -> list = ArrayList(Arrays.asList(*arrayOf("5", "6", "7", "8", "9")))
            "围大" -> list = ArrayList(
                Arrays.asList(
                    *arrayOf(
                        "5",
                        "6",
                        "7",
                        "8",
                        "9",
                        "35",
                        "45",
                        "57",
                        "46",
                        "67",
                        "68",
                        "79",
                        "89",
                        "4567",
                        "6789",
                        "56789"
                    )
                )
            )

            "红数" -> list = ArrayList(Arrays.asList(*arrayOf("0", "3", "4", "7", "8")))
            "黄数" -> list = ArrayList(Arrays.asList(*arrayOf("1", "2", "5", "6", "9")))
            "单数" -> list = ArrayList(Arrays.asList(*arrayOf("1", "3", "5", "7", "9")))
            "围单数" -> list =
                ArrayList(Arrays.asList(*arrayOf("1", "3", "5", "7", "9", "13", "35", "57", "79")))

            "双数" -> list = ArrayList(Arrays.asList(*arrayOf("0", "2", "4", "6", "8")))
            "围双数" -> list =
                ArrayList(Arrays.asList(*arrayOf("0", "2", "4", "6", "8", "02", "24", "46", "68")))

            "12479" -> list = ArrayList(Arrays.asList(*arrayOf("1", "2", "4", "7", "9")))
            "02358" -> list = ArrayList(Arrays.asList(*arrayOf("0", "2", "3", "5", "8")))
            "01689" -> list = ArrayList(Arrays.asList(*arrayOf("0", "1", "6", "8", "9")))
            "369" -> list = ArrayList(Arrays.asList(*arrayOf("3", "6", "9")))
        }
        return list
    }

    /**
     * 计算围指定数字结果 ---所有版面数字情况下(只围一个数的情况下, 及默认5倍区 2倍区, 2.5倍区全双倍)
     *
     * @param allNumbers
     * @return 1, 计算当前下注总数
     * 2, 判断遍历数字是否等于指定数字, 否 则减 是则计算总结果及净值
     */
    fun getEncloseSpecialNumResult(resultBean: NumEncloseBean, allNumbers: String): MutableList<String> {
        val resultList: MutableList<String> = ArrayList()
        if (AwDataUtil.isEmpty(allNumbers)) {
            return resultList
        }
        val dateStr = AwDateUtil.formatDate(Date(System.currentTimeMillis()), "HH:mm:ss")
        //        resultList.add(dateStr + "\n\n");
        val sb = StringBuffer()
        val list: MutableList<Int> = ArrayList()
        for (i in 0 until allNumbers.length) {
            list.add(AwDataUtil.getIntValue(allNumbers[i].toString()))
        }
        var totalSilver = 0
        var totalSkin = 0
        var totalGemstone = 0
        var totalWinSilver = 0
        var totalWinSkin = 0
        var totalWinGemstone = 0
        val specNumber = resultBean.resultNumber
        //非2倍格子暂时不考虑双倍下注
        val silverCount = resultBean.silverCount
        val skinCount = resultBean.skinCount
        val gemstoneCount = resultBean.gemstoneCount
        var tempSilver = 0
        var tempSkin = 0
        var tempGemstone = 0
        var bettingNumsDesc = "" //投注的格子 如下注0 则是0, 01, 02, 0123, 01234
        //计算下注总数(暂不考虑双倍下注情况)
        if (specNumber == 0 || specNumber == 1 || specNumber == 8 || specNumber == 9) {
            //周围4个格子 + 1个2倍区格子
            tempSilver = silverCount * 5
            tempSkin = skinCount * 5
            tempGemstone = gemstoneCount * 5
        } else {
            //周围6个格子 + 1个2倍区格子
            tempSilver = silverCount * 7
            tempSkin = skinCount * 7
            tempGemstone = gemstoneCount * 7
        }
        //        resultList.add("【" + dateStr + "】 " + "\n\n每轮投注\n银: " + tempSilver + ", 硬皮: " + tempSkin + ", 宝石: " + tempGemstone);
        for (item in list) {
            //为了展示各个数字的下注及开奖结果总数, 多定义几个变量.
            var tempWinSilver = 0
            var tempWinSkin = 0
            var tempWinGemstone = 0
            when (specNumber) {
                0 -> {
                    bettingNumsDesc = "0，01，02，0123，01234"
                    if (item == 1 || item == 2) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 3) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 4) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 0) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            gemstoneCount
                        )
                    }
                }

                1 -> {
                    bettingNumsDesc = "1，01，13，0123，01234"
                    if (item == 0 || item == 3) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 2) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 4) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 1) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            gemstoneCount
                        )
                    }
                }

                2 -> {
                    bettingNumsDesc = "2，02，23，24，0123，2345，01234"
                    if (item == 0) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 3 || item == 4) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, skinCount)
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T5_T2Point5_2_T2,
                            gemstoneCount
                        )
                    } else if (item == 1) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, gemstoneCount)
                    } else if (item == 2) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                3 -> {
                    bettingNumsDesc = "3，13，23，35，0123，2345，01234"
                    if (item == 1) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 2) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, skinCount)
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T5_T2Point5_2_T2,
                            gemstoneCount
                        )
                    } else if (item == 0 || item == 4) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, gemstoneCount)
                    } else if (item == 3) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                4 -> {
                    bettingNumsDesc = "4，24，45，46，2345，4567,01234"
                    if (item == 0 || item == 1) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 2) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 3) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2, gemstoneCount)
                    } else if (item == 6) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, gemstoneCount)
                    } else if (item == 7) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, gemstoneCount)
                    } else if (item == 4) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                5 -> {
                    bettingNumsDesc = "5，35，45，57，2345，4567，56789"
                    if (item == 2) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, gemstoneCount)
                    } else if (item == 3) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, gemstoneCount)
                    } else if (item == 4) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, skinCount)
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T5_T2Point5_2_T2,
                            gemstoneCount
                        )
                    } else if (item == 6) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 7) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 8 || item == 9) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                6 -> {
                    bettingNumsDesc = "6，46，67，68，4567，6789，56789"
                    if (item == 4) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_2_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_2_T2, gemstoneCount)
                    } else if (item == 7) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, skinCount)
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T5_T2Point5_2_T2,
                            gemstoneCount
                        )
                    } else if (item == 8) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 9) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 6) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                7 -> {
                    bettingNumsDesc = "7，57，67，79，4567，6789，56789"
                    if (item == 4) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5, gemstoneCount)
                    } else if (item == 5) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 6) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_2_T2, skinCount)
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T5_T2Point5_2_T2,
                            gemstoneCount
                        )
                    } else if (item == 8) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 9) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 7) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2,
                            gemstoneCount
                        )
                    }
                }

                8 -> {
                    bettingNumsDesc = "8，68，89，6789，56789"
                    if (item == 5) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 6 || item == 9) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 7) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 8) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            gemstoneCount
                        )
                    }
                }

                9 -> {
                    bettingNumsDesc = "9，79，89，6789，56789"
                    if (item == 5) {
                        tempWinSilver = getMultipleTotal(NumMutipleEnums.Multiple_T2, silverCount)
                        tempWinSkin = getMultipleTotal(NumMutipleEnums.Multiple_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2, gemstoneCount)
                    } else if (item == 6) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T2Point5_T2, gemstoneCount)
                    } else if (item == 7 || item == 8) {
                        tempWinSilver =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, silverCount)
                        tempWinSkin =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, skinCount)
                        tempWinGemstone =
                            getMultipleTotal(NumMutipleEnums.Multiple_T5_T2Point5_T2, gemstoneCount)
                    } else if (item == 9) {
                        tempWinSilver = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            silverCount
                        )
                        tempWinSkin = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            skinCount
                        )
                        tempWinGemstone = getMultipleTotal(
                            NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2,
                            gemstoneCount
                        )
                    }
                }
            }
            totalSilver += tempSilver
            totalSkin += tempSkin
            totalGemstone += tempGemstone
            totalWinSilver += tempWinSilver
            totalWinSkin += tempWinSkin
            totalWinGemstone += tempWinGemstone
            sb.append(
                """
    当前数字：$item
    收入: 银：$tempWinSilver，硬皮：$tempWinSkin，宝石：$tempWinGemstone
    利润: 银：${tempWinSilver - tempSilver}，硬皮：${tempWinSkin - tempSkin}，宝石：${tempWinGemstone - tempGemstone}
    
    
    """.trimIndent()
            )
        }
        resultList.add(
            """
    №.【$dateStr】  围数：${resultBean.resultNumber}，共计：${list.size}轮
    
    1️⃣【单场数字】 $bettingNumsDesc
    2️⃣【单场成本】 银：$tempSilver，硬皮：$tempSkin，宝石：$tempGemstone
    3️⃣【总成本】 银：$totalSilver，硬皮：$totalSkin，宝石：$totalGemstone
    4️⃣【总收入】 银：$totalWinSilver，硬皮：$totalWinSkin，宝石：$totalWinGemstone
    5️⃣【总利润】 银：${totalWinSilver - totalSilver}，硬皮：${totalWinSkin - totalSkin}，宝石：${totalWinGemstone - totalGemstone}
    """.trimIndent()
        )
        //                + "6️⃣
        resultList.add("详细投注信息\n$sb")
        return resultList
        //        return "结果数字: " + resultBean.getResultNumber() + "\n下注: 银: " + totalSilver + ", 硬皮: " + totalSkin + ", 宝石: " + totalGemstone + "\n"
//                + "开奖: 银: " + totalWinSilver + ", 硬皮: " + totalWinSkin + ", 宝石: " + totalWinGemstone + "\n"
//                + "盈亏: 银: " + (totalWinSilver - totalSilver) + ", 硬皮: " + (totalWinSkin - totalSkin) + ", 宝石: " + (totalWinGemstone - totalGemstone);
    }

    /**
     * @param multiple 倍率 如10倍数字结果
     * @param singleCount   下注的单倍数量
     * @return
     */
    private fun getMultipleTotal(multiple: Enum<*>, singleCount: Int): Int {
        //TODO 暂时不考虑双倍下注情况, 如有需要, 可在扩展方法替换
//        if(singleCount <= 10) {
//            doubleCount = 2 * singleCount;
//        }
        //0, 01, 02, 0123, 01234
        //7, 57, 67, 79, 4567, 6789, 56789
        return if (multiple === NumMutipleEnums.Multiple_T5_T2Point5_T2) {
            (singleCount * 5 + Math.floor(singleCount * 2.5) + singleCount * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T5_T2Point5_2_T2) {
            (singleCount * 5 + Math.floor(singleCount * 2.5) * 2 + singleCount * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T5_T2Point5) {
            (singleCount * 5 + Math.floor(singleCount * 2.5)).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T5_T2Point5_2) {
            (singleCount * 5 + Math.floor(singleCount * 2.5) * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T2Point5_T2) {
            (Math.floor(singleCount * 2.5) + singleCount * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T2Point5_2_T2) {
            (Math.floor(singleCount * 2.5) * 2 + singleCount * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T2) {
            singleCount * 2
        } else if (multiple === NumMutipleEnums.Multiple_T2Point5) {
            Math.floor(singleCount * 2.5).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T10_T5_2_T2Point5_T2) {
            (singleCount * 10 + singleCount * 5 * 2 + Math.floor(singleCount * 2.5) + singleCount * 2).toInt()
        } else if (multiple === NumMutipleEnums.Multiple_T10_T5_3_T2Point5_2_T2) {
            (singleCount * 10 + singleCount * 5 * 3 + Math.floor(singleCount * 2.5) * 2 + singleCount * 2).toInt()
        } else {
            0
        }
    }

    val encloseList: MutableList<NumEncloseBean>
        get() {
            val list: MutableList<NumEncloseBean> = ArrayList()
            for (i in 0..9) {
                list.add(NumEncloseBean(i))
            }
            var silverCount = 0
            var skinCount = 0
            var gemstoneCount = 0
            if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_10.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 10
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_20.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 20
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_40.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_20.desc) {
                silverCount = 2
                skinCount = 2
                gemstoneCount = 20
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_40.desc) {
                silverCount = 2
                skinCount = 2
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_3_3_30.desc) {
                silverCount = 3
                skinCount = 3
                gemstoneCount = 30
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_4_4_40.desc) {
                silverCount = 4
                skinCount = 4
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_50.desc) {
                silverCount = 5
                skinCount = 5
                gemstoneCount = 50
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_100.desc) {
                silverCount = 5
                skinCount = 5
                gemstoneCount = 100
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_100.desc) {
                silverCount = 10
                skinCount = 10
                gemstoneCount = 100
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_200.desc) {
                silverCount = 10
                skinCount = 10
                gemstoneCount = 200
            } else {
                val bettingCustomArrays = AppCacheUtil.getBettingCustom().split("/".toRegex())
                    .dropLastWhile { it.isEmpty() }
                    .toTypedArray()
                silverCount = AwDataUtil.getIntValue(bettingCustomArrays[0])
                skinCount = AwDataUtil.getIntValue(bettingCustomArrays[1])
                gemstoneCount = AwDataUtil.getIntValue(bettingCustomArrays[2])
            }
            for (itemBean in list) {
                itemBean.silverCount = silverCount
                itemBean.skinCount = skinCount
                itemBean.gemstoneCount = gemstoneCount
                itemBean.isChecked = false
            }
            return list
        }
    val imitateList: MutableList<NumItemBean>
        get() {
            val list: MutableList<NumItemBean> = ArrayList()
            list.add(NumItemBean("0", 10f, ArrayList(Arrays.asList(*arrayOf(0)))))
            list.add(NumItemBean("1", 10f, ArrayList(Arrays.asList(*arrayOf(1)))))
            list.add(NumItemBean("2", 10f, ArrayList(Arrays.asList(*arrayOf(2)))))
            list.add(NumItemBean("3", 10f, ArrayList(Arrays.asList(*arrayOf(3)))))
            list.add(NumItemBean("4", 10f, ArrayList(Arrays.asList(*arrayOf(4)))))
            list.add(NumItemBean("5", 10f, ArrayList(Arrays.asList(*arrayOf(5)))))
            list.add(NumItemBean("6", 10f, ArrayList(Arrays.asList(*arrayOf(6)))))
            list.add(NumItemBean("7", 10f, ArrayList(Arrays.asList(*arrayOf(7)))))
            list.add(NumItemBean("8", 10f, ArrayList(Arrays.asList(*arrayOf(8)))))
            list.add(NumItemBean("9", 10f, ArrayList(Arrays.asList(*arrayOf(9)))))
            var silverCount = 0
            var skinCount = 0
            var gemstoneCount = 0
            if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_10.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 10
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_20.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 20
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_1_1_40.desc) {
                silverCount = 1
                skinCount = 1
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_20.desc) {
                silverCount = 2
                skinCount = 2
                gemstoneCount = 20
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_2_2_40.desc) {
                silverCount = 2
                skinCount = 2
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_3_3_30.desc) {
                silverCount = 3
                skinCount = 3
                gemstoneCount = 30
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_4_4_40.desc) {
                silverCount = 4
                skinCount = 4
                gemstoneCount = 40
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_50.desc) {
                silverCount = 5
                skinCount = 5
                gemstoneCount = 50
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_5_5_100.desc) {
                silverCount = 5
                skinCount = 5
                gemstoneCount = 100
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_100.desc) {
                silverCount = 10
                skinCount = 10
                gemstoneCount = 100
            } else if (AppCacheUtil.getBettingConfigCount() == NumBettingEnums.MODE_10_10_200.desc) {
                silverCount = 10
                skinCount = 10
                gemstoneCount = 200
            } else {
                val bettingCustomArrays = AppCacheUtil.getBettingCustom().split("/".toRegex())
                    .dropLastWhile { it.isEmpty() }
                    .toTypedArray()
                silverCount = AwDataUtil.getIntValue(bettingCustomArrays[0])
                skinCount = AwDataUtil.getIntValue(bettingCustomArrays[1])
                gemstoneCount = AwDataUtil.getIntValue(bettingCustomArrays[2])
            }
            for (itemBean in list) {
                itemBean.setSilverCount(silverCount)
                itemBean.setSkinCount(skinCount)
                itemBean.setGemstoneCount(gemstoneCount)
                itemBean.isChecked = false
            }
            return list
        }
}